/*
 * @Author: your name
 * @Date: 2021-10-05 19:22:13
 * @LastEditTime: 2021-10-05 19:58:53
 * @LastEditors: Please set LastEditors
 * @Description: In User Settings Edit
 * @FilePath: \luogu\1.2排序\P1271\main.cpp
 */
#include<iostream>
using namespace std;
#define MAX_N 1010

int main(){
  int n,m;
  int n_array[MAX_N];
  int votenum;
  //输入数据
  cin >> n >> m;
  //初始化n_array
  for(int i=1; i<=n; i++){
    n_array[i] = 0;
  } 
  //选民投票
  for(int i=0; i<m; i++){
    cin >> votenum;
    //统计每个人得票数
    n_array[votenum]++;
  }

  //输出票
  int i;
  for(i=1; i<=n; i++){
    for(int j=0; j<n_array[i]; j++){
      cout << i << " ";
    }
  }
  return 0;
}